package wqh.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import wqh.domain.AlarmNoneInfor;


import java.util.List;

/**
 * Created by devts on 2016/10/20.
 */
public interface AlarmNoneInforDao {


    List<AlarmNoneInfor> findAllRecord();

    @Insert("INSERT alarm_none_infor (ip, dev_type, dev_addr, dev_status, alarm_time, confirm_status) VALUES(" +
            "#{ip}, #{dev_type}, #{dev_addr}, #{dev_status}, #{alarm_time}, #{confirm_status})")
    int insertRecord(AlarmNoneInfor alarmNoneInfor);

    @Update("UPDATE alarm_none_infor SET confirm_status = #{0} WHERE id = #{1}")
    int updateConfirmStatusById(Byte confirm_status, Integer id);

    @Delete("DELETE FROM alarm_none_infor WHERE id = #{1}")
    int deleteById(Integer id);

    @Delete("TRUNCATE TABLE alarm_none_infor")
    void deleteAll();

}
